﻿<UserControl x:Class="Wp7Tools.Controls.AsyncCachedImage"
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
	mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="200" d:DesignWidth="400"
	>
	<Grid Background="Gray">
		<Image x:Name="Image" 
			   Stretch="UniformToFill"
			   RenderTransformOrigin="0.5, 0.5" 
			   CacheMode="BitmapCache"
			   ManipulationStarted="ImageManipulationStarted"
			   ManipulationCompleted="ImageManipulationCompleted"
			   VerticalAlignment="Top" 
			   HorizontalAlignment="Center"
			   d:Source="/Images/robertacarlucci.jpg"
			   >
			<Image.RenderTransform>
				<CompositeTransform x:Name="transform" />
			</Image.RenderTransform>
			<toolkit:GestureService.GestureListener>
				<toolkit:GestureListener PinchStarted="OnPinchStarted" 
										 PinchDelta="OnPinchDelta" 
										 DoubleTap="ImageDoubleTap"
										 DragStarted="DragStarted"
										 DragDelta="DragDelta"
										 DragCompleted="DragCompleted"
										 />
			</toolkit:GestureService.GestureListener>
		</Image>

		<Grid Height="60" VerticalAlignment="Bottom">
			<Rectangle x:Name="TextBlockBox" 
					   Width="Auto" 
					   Height="60" 
					   Fill="Black" 
					   Opacity="0.8" 
					   Visibility="Collapsed" />
			<TextBlock x:Name="Title"
					   Style="{StaticResource PhoneTextNormalStyle}"
					   FontFamily="{StaticResource PhoneFontFamilySemiBold}"
					   Foreground="White"
					   TextWrapping="Wrap" 
					   Width="Auto" 
					   VerticalAlignment="Top"
					   Margin="2,0,0,0" />
		</Grid>
	</Grid>
</UserControl>

